import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_jd/pages/tabbar/my/controller.dart';
import 'package:flutter_jd/routes/routing_constants.dart';
import 'package:flutter_jd/ui/widgets/kit.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/route_manager.dart';

// 顶栏
class MyTopBar extends GetWidget<MyController> {
  @override
  Widget build(BuildContext context) {
    return Obx(
      () => Opacity(
        opacity: controller.appBarAlpha.value,
        child: Container(
          height: 80.h,
          padding: EdgeInsets.only(top: 32.h, left: 12.w, right: 12.w),
          decoration: BoxDecoration(
            color: Colors.white,
            border: Border(
              bottom: BorderSide(
                color: Color(0xFFF9F9F9),
              ),
            ),
          ),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Container(
                width: 90.w,
                child: Row(
                  children: [Kit.iconFont(0xe600, Color(0xFF333333), 20.sp)],
                ),
              ),
              Text(
                "我的",
                style: TextStyle(
                  fontSize: 17.sp,
                  fontWeight: FontWeight.w500,
                ),
              ),
              Container(
                width: 90.w,
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.end,
                  children: [
                    GestureDetector(
                      onTap: () {
                        Get.toNamed(SettingRoute);
                      },
                      child: Container(
                        margin: EdgeInsets.only(right: 12.w),
                        child: Kit.iconFont(0xe612, Color(0xFF333333), 20.sp),
                      ),
                    ),
                    Kit.iconFont(0xe8b8, Color(0xFF333333), 20.sp),
                  ],
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}
